//
//  HelloWorldLayer.m
//  Project
//
//  Created by Nguyen Tan Loc on 8/10/13.
//  Copyright Nguyen Tan Loc 2013. All rights reserved.
//



#import "HelloWorldLayer.h"
#import "AppDelegate.h"


#pragma mark - HelloWorldLayer

@implementation HelloWorldLayer

// Helper class method that creates a Scene with the HelloWorldLayer as the only child.
+(CCScene *) scene
{
	CCScene *scene = [CCScene node];
	HelloWorldLayer *layer = [HelloWorldLayer node];
	[scene addChild: layer];
	return scene;
}

-(id) init
{
	if( (self=[super init]) )
    {
        [[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:PLIST_INGAME textureFilename:IMAGE_INGAME];
        
        [[LevelManager shareLevelManager] setCurrentLevelt:0];
        [[LevelManager shareLevelManager] loadCurrentLevel];
        path = [[[LevelManager shareLevelManager] getPath] retain];
        [self addChild:path];
        
        Line *line = [[Line alloc] init];
        [line setPosition:ccp(120, 500)];
        [line setLength:100];
        [self addChild:line];
        
        [self scheduleUpdate];
	}
	return self;
}

-(void) update:(ccTime)delta
{
    
}

- (void) dealloc
{
	[super dealloc];
}

@end
